/*
 * @Author: your name
 * @Date: 2022-01-13 14:42:05
 * @LastEditTime: 2022-06-13 13:49:52
 * @LastEditors: lp 654528967@qq.com
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \nien-vue3-admin\src\utils\auth.ts
 */
export const token = 'token'
export const setToken = (v: string): void => localStorage.setItem(token || '', v)
export const getToken = (): string | null => localStorage.getItem(token)

export const expiresIn = 'expires_in'
export const setExpiresIn = (v: number) => localStorage.setItem(expiresIn || '0', `${ v }`)
export const getExpiresIn = (): number => Number(localStorage.getItem(expiresIn))
export const refreshToken = 'refresh_token'
export const setRefreshToken = (v: string) => localStorage.setItem(refreshToken || '', v)
export const getRefreshToken = (): string | null => localStorage.getItem(refreshToken)
export const tokenType = 'token_type'
export const setTokenType = (v: string) => localStorage.setItem(tokenType || '', v)
export const getTokenType = (): string | null => localStorage.getItem(tokenType)
export const company = 'company'
export const getCompany = (): string | null => localStorage.getItem(company)
export const setCompany = (v:string) => localStorage.setItem(company, v)
